/*
 * XXX
 */

package edu.uhcl.csci4838.group3.view.help;

import edu.uhcl.csci4838.group3.R;
import edu.uhcl.csci4838.group3.view.EditSemesterActivity;
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * XXX
 * 
 * @author XXX
 */
public class HelpActivity extends ListActivity {
	
	
	/**
	 * XXX
	 * 
	 * @param savedInstanceState
	 */
	/* 
	 * (non-Javadoc)
	 * 
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setTitle("Help Topics - BackpackEDU");
		requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
		HelpActivity.this.setProgressBarIndeterminateVisibility(false);
		this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		this.setContentView(R.layout.activity_view_help);
		ArrayAdapter adapter = new ArrayAdapter(this,
				R.layout.settingsitem,
				R.id.tv_settingsitem,
				getResources().getStringArray(R.array.helpViewList));
		setListAdapter(adapter);
	}
	
	/**
	 * XXX
	 * 
	 * @param l
	 * @param v
	 * @param position
	 * @param id
	 */
	/* 
	 * (non-Javadoc)
	 * 
	 * @see android.app.ListActivity#onListItemClick(android.widget.ListView, android.view.View, int, long)
	 */
	
	@Override
	protected void onListItemClick(ListView l,
			View v,
			int position,
			long id) {
		super.onListItemClick(l,
				v,
				position,
				id);
		l.getItemAtPosition(position);
		
		if (position == 0) {
			this.startActivity(new Intent(this.getApplicationContext(),
					AgendaHelpActivity.class));
		}
		
		if (position == 1) {
			this.startActivity(new Intent(this.getApplicationContext(),
					CalendarHelpActivity.class));
		}
		
		if (position == 2) {
			this.startActivity(new Intent(this.getApplicationContext(),
					CoursesHelpActivity.class));
		}
		
		if (position == 3) {
			this.startActivity(new Intent(this.getApplicationContext(),
					SettingsHelpActivity.class));
		}
	}
}
